As a compound having a pharmacological activity, various heterocyclic compounds are known. Japanese Patent Application Laid-Open Publication No. 2007-534696 (JP-2007-534696A, Patent Document 1) discloses a modified antihistamine compound represented by the formula [AH]-A (wherein AH represents an antihistamine moiety, A represents a linker molecule comprising SP and Z, wherein SP is a spacer molecule and Z is a drug modulating moiety). This document also discloses a pheniramine-like compound and a diphenhydramine-like compound.
WO 03/057223 (Patent Document 2) discloses a δ opioid receptor agonist represented by the following formula:

wherein Ar1 is a 5- or 6-membered carbocyclic or aromatic heterocyclic ring which may have a substituent; Z is a hydrogen, a carboxyl group or an ester group thereof, or the like; G is a carbon or a nitrogen; R2 is a hydrogen, a C1-4alkyl group, or the like; R3 and R4 are a hydrogen or a C1-6alkyl group, R4 may form a C═O group; R5 is a hydrogen, an alkoxy group, or the like; R6 is a phenyl, a halogen, or the like; and R7 is a hydrogen, a C1-8alkyl group, or the like.
WO 01/046166 (Japanese Patent Application Laid-Open Publication No. 2003-518107, Patent Document 3) discloses compounds represented by the following formulae (piperazine derivatives having benzhydril and a 6-membered heterocyclic moiety) for treating conditions associated with aberrant N-type calcium channel activity. This document also discloses that the compounds are also useful for treating stroke, migraine, chronic neuropathic and acute pain, hypertension, cardiac arrhythmia, and other diseases.

In the formulae, Z1 and Z2 are N or CH, one of Z1 and Z2 is N; n1 is 1, n2 is 0 or 1; X1 and X2 are a straight chain linker; Ar is an aromatic monocyclic ring or an aromatic heterocyclic monocyclic ring, Cy is an alicyclic monocyclic ring or a heterocyclic monocyclic ring, or the like; Ya and Yb are an aromatic monocyclic ring or an aromatic heterocyclic monocyclic ring, an alicyclic monocyclic ring or a heterocyclic monocyclic ring, or the like; l1 is 0 or 1; and R1 is a C1-6alkyl, a C6-10aryl, a C7-16arylalkyl, or the like.
Patent Document 3 specifically discloses compounds in which Z1 and Z2 are N, X1 is a C2-6alkylene group or a C1-5alkylene-CO—, X2 is a methylene group, an ethylene group, or an alkenylene group, Ya is a cyclohexyl group and a phenyl group, and Ar is a phenyl group.
Japanese Patent Application Laid-Open Publication No. 2004-51600 (JP-2004-51600A, Patent Document 4) discloses a hematopoietic organ-type prostaglandin D2 synthetic enzyme inhibitor represented by the following formula and also discloses that the inhibitor has an antiallergic effect (or action), an anti-allergic-inflammation, and/or an antiasthmatic effect.

In the formula, X is a single bond, a C1-6alkylene group, or the like; R1 is a C6-10aryl group; R2 is a hydrogen atom, a C1-6alkyl group, or a C6-10aryl group; R3 is an acyl group or a 4- to 10-membered cyclic group; and R4 and R5 is a hydrogen atom, or R4 and R5 bond together to form a C1-4alkylene group.
This document also discloses a compound represented by the formula in which X is carbonyl group, R1 and R2 are phenyl group, and R3 is 4-methoxycarbonylphenyl group (Compound Number 27).
Japanese Patent Application Laid-Open Publication No. 2009-504637 (JP-2009-504637A, Patent Document 5) discloses apiperazine compound represented by the following formula useful for the treatment of obesity, psychiatric and neurological disorders.

In the formula, G is selected from the group consisting of CH and N; R1 and R2 are independently a hydrogen atom or the like; m and n are independently selected from 1 to 5; X is a bond, —C(═O)—, or the like; L is a bond, —(CH2)p—, or the like; p is selected from 0, 1 and 2; R3 is, for example, a C6-10aryl group substituted by a substituent such as a C1-6alkoxy or —CO2R5 (wherein R5 is a hydrogen, a C1-6alkyl, or the like); at least one of X and L is not a bond.
Patent Document 5 specifically discloses a compound represented by the formula in which G is N and X is carbonyl group.